package com.wjk.kylin.mall.admin.controller;


import com.wjk.kylin.mall.admin.service.IRoleMenuService;
import com.wjk.kylin.mall.common.core.dto.admin.MenuComponentInDTO;
import com.wjk.kylin.mall.common.core.dto.base.BaseOutDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 角色信息表 前端控制器
 * </p>
 *
 * @author wangjinkui
 * @since 2021-11-14
 */
@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private IRoleMenuService roleMenuService;

    /**
     * TODO 网关调用-未登录
     * 根据访问路径查询角色
     *
     * @param inDTO
     * @return
     */
    @PostMapping("/getRoleIdByComponent")
    public BaseOutDTO getRoleIdByComponent(@Validated @RequestBody MenuComponentInDTO inDTO) {
        return roleMenuService.getRoleIdByComponent(inDTO);
    }
}

